import request from '@/utils/request'

export function getPlayBackId() {
    return request({
      url: '/playback/getPlayBackId',
      method: 'get'
    })
  }   

export function startPlayBack(datetime,startDateTime,endDateTime,playBackId) {
    return request({
      url: '/playback/startPlayBack',
      method: 'POST',
      params: { datetime:datetime,startDateTime:startDateTime,endDateTime:endDateTime,playBackId:playBackId }
    })
  } 

// export function reStartPlayBack(datetime,playBackId) {
//     return request({
//       url: '/playback/reStartPlayBack',
//       method: 'POST',
//       params: { datetime:datetime,playBackId:playBackId }
//     })
//   }


export function pausePlayBack(playBackId) {
    return request({
      url: '/playback/pausePlayBack',
      method: 'POST',
      params: { playBackId }
    })
  }   

export function endpausePlayBack(playBackId) {
    return request({
      url: '/playback/endpausePlayBack',
      method: 'POST',
      params: { playBackId }
    })
  } 

export function endPlayBack(playBackId) {
    return request({
      url: '/playback/endPlayBack',
      method: 'POST',
      params: { playBackId }
    })
  }    

export function updateSpeed(playBackId,speed) {
    return request({
      url: '/playback/updateSpeed',
      method: 'POST',
      params: { playBackId:playBackId,speed:speed }
    })
  }      

export function updatePlayBackState(playBackId) {
    return request({
      url: '/playback/updatePlayBackState',
      method: 'POST',
      params: { playBackId:playBackId}
    })
  }    